<template>
  <div class="li">
    <a @click="handelClick(item)">
      <img :src="item.productImg" alt="">
      <div class="title">
        <p>{{item.productTitle}}</p>
      </div>
      <span class="pirse">￥{{item.sellPrice}}</span>
      <s v-show="item.sellPrice-item.originalPrice">{{item.originalPrice}}</s>
      <p> {{item.prizeOrSlogan}}</p>
    </a>
  </div>
</template>
<script>
export default {
  props: ['item'],
  methods: {
   handelClick(item){
     this.$router.push(`/item/${item.productId}`) 
     this.$store.commit('setDataList',this.item)
   }
  },
  mounted() {
    
  }
}
</script>
<style lang="scss">
  .li{
    width: 49.8%;
    float: left;
    border-right: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
    box-sizing: border-box;
    position: relative;
    padding-bottom: 5px;
    height: 274px;
    a{
      display: block;
      width: 100%;
      position: relative;
      font-size: 0;
      padding-bottom: 5px;
      color: #555;
      img{
        display: block;
        height: 185.5px;
        margin: 0 auto 0
      }
      .title{
        box-sizing: border-box;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        position: relative;
        margin-bottom: 2.5px;
        width: 88%;
        margin-top: 25px;
        p{
          color: #808080;
          font-size: 14px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          width: 100%;
        }
      }
      span{
        display: inline-block;
        font-family: PingFangSC-Regular;
        font-size: 15px;
        color: #000;
        margin-right: 5px;
        margin-left: 15px;
      }
      p{
        color: #808080;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 80%;
        margin-left: 15px;
      }
      s{
        display: inline-block;
        font-family: PingFangSC-Regular;
        font-size: 12px;
        color: #AAAAAA;
        margin-bottom: 2.5px;
      }
    }
  }
</style>
